function handleStr(str: string) {
  return str.replace(/\/\//g, '/');
}

export const handlename = (it: string, name: string) => {
  let path = '',
    routeName = '';
  routeName += 'menus/' + name;
  if (it) {
    routeName += '/' + it;
  }
  routeName = routeName.replace(/(menus\/)+/, 'menus/');
  path = handleStr(routeName.replace('menus', ''));
  routeName = handleStr(routeName);
  return { routeName, path };
};
